RISC-V: Define struct hid_bpf_ctx to fix kselftest hid-bpf compilation#124
Merged
sterling-teng merged 3 commits intoRVCK-Project:rvck-6.6from Sep 7, 2025
Merged
Conversation
added 3 commits
September 4, 2025 15:48
stable inclusion from stable-v6.12.1 commit ae7487d category: bugfix bugzilla: RVCK-Project#123 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ae7487d112cf9f310d32f27d5956f53d9f143fea -------------------------------- For the hid-bpf tests to compile, we need to have the definition of struct hid_bpf_ctx. This definition is an internal one from the kernel and it is supposed to be defined in the generated vmlinux.h. This vmlinux.h header is generated based on the currently running kernel or if the kernel was already compiled in the tree. If you just compile the selftests without compiling the kernel beforehand and you are running on a 6.2 kernel, you'll end up with a vmlinux.h without the hid_bpf_ctx definition. Use the clever trick from tools/testing/selftests/bpf/progs/bpf_iter.h to force the definition of that symbol in case we don't find it in the BTF and also add __attribute__((preserve_access_index)) to further support CO-RE functionality for these tests. Signed-off-by: Justin Stitt <justinstitt@google.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com> # Build Tested-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-1-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Yafen Fang <yafen@iscas.ac.cn>
stable inclusion from stable-v6.12.1 commit 89d024a category: bugfix bugzilla: RVCK-Project#123 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=89d024a7ba02b6b969f89ac057442b5d3bcb4272 -------------------------------- "make headers" is a requirement before calling make on the selftests dir, so we should not have to manually install those headers Acked-by: Shuah Khan <skhan@linuxfoundation.org> Tested-by: Nick Desaulniers <ndesaulniers@google.com> # Build Tested-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-2-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Yafen Fang <yafen@iscas.ac.cn>
stable inclusion from stable-v6.12.1 commit 9193963 category: bugfix bugzilla: RVCK-Project#123 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=91939636cac4585e5c99a15c8b9023e0dcabb4e5 -------------------------------- Turns out that we were relying on the globally installed headers, not the ones we freshly compiled. Add a manual include in CFLAGS to sort this out. Tested-by: Nick Desaulniers <ndesaulniers@google.com> # Build Tested-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-3-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Yafen Fang <yafen@iscas.ac.cn>
|
开始测试 |
4769b09 to
068235b
Compare
|
开始测试 |
|
check patch done. log: https://jenkins.oerv.ac.cn/job/rvck-pipeline/job/check-patch/156/consoleFull |
|
Kernel build success! |
|
kunit test done. log:https://jenkins.oerv.ac.cn/job/rvck-pipeline/job/kunit-test/163/consoleFull |
|
Kernel build success! |
|
kunit test done. log:https://jenkins.oerv.ac.cn/job/rvck-pipeline/job/kunit-test/164/consoleFull |
|
Lava check done! result url: https://lava.oerv.ac.cn/results/648/0_rvck_common-test_qemu |
Contributor
|
该pr系CI修复相关,不会对其它pr造成合并冲突,紧急合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #123.
The following error occurred when building the tests for kselftest.
Link: https://lore.kernel.org/all/20230825-wip-selftests-v3-1-639963c54109@kernel.org/